import axi from 'axios';

export default {
  getExamApi(p) {
    return axi.get('/bquestiondb/queryBQuestionDbByPagination', {
      params: p,
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
  addApi(p) {
    return axi.post('/bquestiondb/add', p, {
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
  updateApi(id, p) {
    return axi.put(`/bquestiondb/update/${id}`, p, {
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
  deleteApi(id) {
    return axi.delete(`/bquestiondb/deleteLogical/${id}`, {
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
  getStatistic(id) {
    return axi.get(`/bexam/statistics/${id}`, {
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
  getStatisticTotal(id) {
    return axi.get(`/bexam/statisticsTotal/${id}`, {
      headers: {
        Authorization: `Bearer ${sessionStorage.getItem('userToken')}`,
      },
    });
  },
};
